//
//  TeamMemberCell.m
//  Shengzhuli
//
//  Created by FXGuo on 17/3/26.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "TeamMemberCell.h"
#import <UIImageView+WebCache.h>

@interface TeamMemberCell()

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *commendLab;

@end

@implementation TeamMemberCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(FriendsDetailModel *)model
{
    _model = model;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.portraitUrl] placeholderImage:GetImage(@"default_goods_image")];
    self.nameLab.text = model.name;
    if (model.referrerPhone.length<11) return;
    NSString *str = [NSString stringWithFormat:@"由%@邀请",model.referrerPhone];
    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc]initWithString:str attributes:@{NSForegroundColorAttributeName:[UIColor blackColor],}];
    [attrStr setAttributes:@{NSForegroundColorAttributeName:RGBColor(216, 30, 6)} range:NSMakeRange(1, 11)];
    self.commendLab.attributedText = attrStr;
}

@end
